package com.lanxum.common.exception;


import com.lanxum.common.enums.CodeEnum;

/**
 * @author: li.sun
 * @create: 2020-05-05 16:11
 * @description:
 **/
public class AppException extends RuntimeException {

    private String code;

    public AppException(String code, String message){
        super(message);
        this.setCode(code);
    }

    public AppException(CodeEnum codeEnum){
        super(codeEnum.getMessage());
        this.setCode(codeEnum.getCode());
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

}
